#ifndef __pidbus_server_h_
#define __pidbus_server_h_

#include <dbus-c++/dbus.h>
#include "glue-dbus-server.h"

static const char* PIDBUS_BUSNAME = "im.pidgin.plugin.dbus";
static const char* PIDBUS_OBJPATH = "/im/pidgin/plugin/dbus";

class PiDBus : 
public inkboard::pidgin::dbus_adaptor, 
public ::DBus::IntrospectableAdaptor,
public ::DBus::ObjectAdaptor
{
        public:
	static PiDBus* getInstance();
        ~PiDBus();

	void newTalk(const std::string& app);
	std::string getContact(const int32_t& tid);
	std::string getAccount(const int32_t& tid);
	std::string getStatus(const int32_t& tid);
	bool dial(const int32_t& tid);
	bool answer(const int32_t& tid);
	bool hangup(const int32_t& tid);
	bool sendMessage(const int32_t& tid, const std::string& text);

	protected:
        PiDBus( ::DBus::Connection& connection );
        static PiDBus* _instance;
};

void processIncomingMessageFromPidgin( std::string to, std::string from, std::string serial, std::string app, std::string recv_data );

#endif
